class GenreateCqPossibleAnswers < ActiveRecord::Migration
  def self.up
  
  	closed_id=QuestionType.find_by_name("closed question").id
  
  	for question in ClosedQuestion.find(:all)
  
	  	0.upto(rand(4)) do |x|
			CQPossibleAnswer.create(:possible_answer=>"Jest ok?",:closed_question_id=>question.id)
		end	
	  	
  	end
  end

  def self.down
  	CQPossibleAnswer.delete_all
  end
end

